%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/v4/unique-constraints"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 8, 9, 49, 50, 51, 52, 53, 54, 10<br />2: 7, 15, 22, 28, 34<br />3: 12, 18, 25, 31, 37<br />ᐳ: 11, 13, 17, 19, 24, 26, 30, 32, 36, 38"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 13<br /><br />ROOT PgSelectSingleᐸpersonᐳ[13]"):::bucket
    Bucket2("Bucket 2 (nullableBoundary)<br />Deps: 19<br /><br />ROOT PgSelectSingleᐸpersonᐳ[19]"):::bucket
    Bucket3("Bucket 3 (nullableBoundary)<br />Deps: 26<br /><br />ROOT PgSelectSingleᐸcompound_keyᐳ[26]"):::bucket
    Bucket4("Bucket 4 (nullableBoundary)<br />Deps: 32<br /><br />ROOT PgSelectSingleᐸcompound_keyᐳ[32]"):::bucket
    Bucket5("Bucket 5 (nullableBoundary)<br />Deps: 38<br /><br />ROOT PgSelectSingleᐸcompound_keyᐳ[38]"):::bucket
    end
    Bucket0 --> Bucket1 & Bucket2 & Bucket3 & Bucket4 & Bucket5

    %% plan dependencies
    PgSelect22[["PgSelect[22∈0] ➊<br />ᐸcompound_keyᐳ<br />More deps:<br />- Constantᐸ1ᐳ[51]<br />- Constantᐸ2ᐳ[52]"]]:::plan
    Object10{{"Object[10∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Object10 --> PgSelect22
    PgSelect34[["PgSelect[34∈0] ➊<br />ᐸcompound_keyᐳ<br />More deps:<br />- Constantᐸ1ᐳ[51]<br />- Constantᐸ100ᐳ[54]"]]:::plan
    Object10 --> PgSelect34
    PgSelect7[["PgSelect[7∈0] ➊<br />ᐸpersonᐳ<br />More deps:<br />- Constantᐸ'sara.smith@email.com'ᐳ[49]"]]:::plan
    Object10 --> PgSelect7
    Access8{{"Access[8∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access9{{"Access[9∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access8 & Access9 --> Object10
    PgSelect15[["PgSelect[15∈0] ➊<br />ᐸpersonᐳ<br />More deps:<br />- Constantᐸ'does.not.exist@email.com'ᐳ[50]"]]:::plan
    Object10 --> PgSelect15
    PgSelect28[["PgSelect[28∈0] ➊<br />ᐸcompound_keyᐳ<br />More deps:<br />- Constantᐸ4ᐳ[53]"]]:::plan
    Object10 --> PgSelect28
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access8
    __Value2 --> Access9
    First11{{"First[11∈0] ➊"}}:::plan
    PgSelectRows12[["PgSelectRows[12∈0] ➊"]]:::plan
    PgSelectRows12 --> First11
    PgSelect7 --> PgSelectRows12
    PgSelectSingle13{{"PgSelectSingle[13∈0] ➊<br />ᐸpersonᐳ"}}:::plan
    First11 --> PgSelectSingle13
    First17{{"First[17∈0] ➊"}}:::plan
    PgSelectRows18[["PgSelectRows[18∈0] ➊"]]:::plan
    PgSelectRows18 --> First17
    PgSelect15 --> PgSelectRows18
    PgSelectSingle19{{"PgSelectSingle[19∈0] ➊<br />ᐸpersonᐳ"}}:::plan
    First17 --> PgSelectSingle19
    First24{{"First[24∈0] ➊"}}:::plan
    PgSelectRows25[["PgSelectRows[25∈0] ➊"]]:::plan
    PgSelectRows25 --> First24
    PgSelect22 --> PgSelectRows25
    PgSelectSingle26{{"PgSelectSingle[26∈0] ➊<br />ᐸcompound_keyᐳ"}}:::plan
    First24 --> PgSelectSingle26
    First30{{"First[30∈0] ➊"}}:::plan
    PgSelectRows31[["PgSelectRows[31∈0] ➊"]]:::plan
    PgSelectRows31 --> First30
    PgSelect28 --> PgSelectRows31
    PgSelectSingle32{{"PgSelectSingle[32∈0] ➊<br />ᐸcompound_keyᐳ"}}:::plan
    First30 --> PgSelectSingle32
    First36{{"First[36∈0] ➊"}}:::plan
    PgSelectRows37[["PgSelectRows[37∈0] ➊"]]:::plan
    PgSelectRows37 --> First36
    PgSelect34 --> PgSelectRows37
    PgSelectSingle38{{"PgSelectSingle[38∈0] ➊<br />ᐸcompound_keyᐳ"}}:::plan
    First36 --> PgSelectSingle38
    PgClassExpression39{{"PgClassExpression[39∈1] ➊<br />ᐸ__person__...full_name”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression39
    PgClassExpression44{{"PgClassExpression[44∈1] ➊<br />ᐸ__person__.”email”ᐳ"}}:::plan
    PgClassExpression39 o--o PgClassExpression44
    PgClassExpression40{{"PgClassExpression[40∈2] ➊<br />ᐸ__person__...full_name”ᐳ"}}:::plan
    PgSelectSingle19 --> PgClassExpression40
    PgClassExpression45{{"PgClassExpression[45∈2] ➊<br />ᐸ__person__.”email”ᐳ"}}:::plan
    PgClassExpression40 o--o PgClassExpression45
    PgClassExpression41{{"PgClassExpression[41∈3] ➊<br />ᐸ__compound...rson_id_1”ᐳ"}}:::plan
    PgSelectSingle26 --> PgClassExpression41
    PgClassExpression46{{"PgClassExpression[46∈3] ➊<br />ᐸ__compound...rson_id_2”ᐳ"}}:::plan
    PgClassExpression41 o--o PgClassExpression46
    PgClassExpression42{{"PgClassExpression[42∈4] ➊<br />ᐸ__compound...rson_id_1”ᐳ"}}:::plan
    PgSelectSingle32 --> PgClassExpression42
    PgClassExpression47{{"PgClassExpression[47∈4] ➊<br />ᐸ__compound...rson_id_2”ᐳ"}}:::plan
    PgClassExpression42 o--o PgClassExpression47
    PgClassExpression43{{"PgClassExpression[43∈5] ➊<br />ᐸ__compound...rson_id_1”ᐳ"}}:::plan
    PgSelectSingle38 --> PgClassExpression43
    PgClassExpression48{{"PgClassExpression[48∈5] ➊<br />ᐸ__compound...rson_id_2”ᐳ"}}:::plan
    PgClassExpression43 o--o PgClassExpression48

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect7,Access8,Access9,Object10,First11,PgSelectRows12,PgSelectSingle13,PgSelect15,First17,PgSelectRows18,PgSelectSingle19,PgSelect22,First24,PgSelectRows25,PgSelectSingle26,PgSelect28,First30,PgSelectRows31,PgSelectSingle32,PgSelect34,First36,PgSelectRows37,PgSelectSingle38 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,PgClassExpression39,PgClassExpression44 bucket1
    classDef bucket2 stroke:#7f007f
    class Bucket2,PgClassExpression40,PgClassExpression45 bucket2
    classDef bucket3 stroke:#ffa500
    class Bucket3,PgClassExpression41,PgClassExpression46 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4,PgClassExpression42,PgClassExpression47 bucket4
    classDef bucket5 stroke:#7fff00
    class Bucket5,PgClassExpression43,PgClassExpression48 bucket5

